<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="com.tangdi.production.mpapp.utils.WebPayServletUtil" %>
<%@ page language="java" import="com.tangdi.production.mpapp.constants.Key" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("on_back", "1");
	

	WebPayServletUtil payUtil = new WebPayServletUtil();

	boolean ok = payUtil.validation(request, response);
	if (!ok) {
		payUtil.toLoginPage(request, response);
	}
	
	request.setAttribute("title","用户中心");
%>
<!DOCTYPE html>
<html lang="zh">
<head>
<base href="<%=basePath%>">
<title>用户中心</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<meta name="description" content="Common form elements and layouts" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<script type="text/javascript" src="js/jquery-1.7.1.min.js"
	charset="UTF-8"></script>

<script type="text/javascript" src="js/core-1.0.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/user/user-info.js" charset="UTF-8"></script>
<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="ace_v1.3/assets/css/bootstrap.css" />

<link rel="stylesheet" href="ace_v1.3/assets/css/chosen.css" />
<link rel="stylesheet" href="ace_v1.3/assets/css/font-awesome.css" />

<!-- text fonts -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace-fonts.css" />

<!-- ace styles -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace.css"
	class="ace-main-stylesheet" id="main-ace-style" />
	
<link rel="stylesheet" href="css/webpay/user_center.css" />

<!--[if lte IE 9]>
			<link rel="stylesheet" href="ace_v1.3/assets/css/ace-part2.css" class="ace-main-stylesheet" />
		<![endif]-->

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="ace_v1.3/assets/css/ace-ie.css" />
		<![endif]-->



<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="ace_v1.3/assets/js/html5shiv.js"></script>
		<script src="ace_v1.3/assets/js/respond.js"></script>
		<![endif]-->
<jsp:include page="../plug/head-include.jsp" />
<style type="text/css">
</style>

</head>
<body class="no-skin">
	<!-- #section:basics/navbar.layout -->
	<jsp:include page="../plug/title.jsp" />

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">

		<!-- #section:basics/sidebar -->
		<!-- /section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<!-- #section:basics/content.breadcrumbs -->
				<!-- /section:basics/content.breadcrumbs -->
				<div class="page-content">
					<!-- #section:settings.box -->
					<!-- <div class="page-header">
						<h1>
							Form Elements <small> <i
								class="ace-icon fa fa-angle-double-right"></i> Common form
								elements and layouts
							</small>
						</h1>
					</div>
					 -->
					<!-- <div class="row">
						<div class="col-xs-12">安徽大智梦信息科技有限公司</div>
					</div> -->
					<!-- <div class="col-sm-8 col-xs-12 col-sm-offset-2 align-center">
						<img src="images/user/logo.png" style="height: 45px;margin: 10px 0 15px 0;">
					</div> -->
					
					<div class="col-sm-8 col-xs-12 col-sm-offset-2 ">
						<div class="mer-info">
							<div class="userName">
								<span valueOf="{custName}"></span>
								<span style="font-size: 12px;">您好！</span>
							</div>
							<div >
								登录账户：<span valueOf="{custLogin}"></span>
							</div>
							<!-- <div>
								结算账户：<span valueOf="{cardNo}" init-format="doCard('{value}')"><a href="javascript:void(0)" onclick="$('.menu-certification').trigger('click')">未绑定</a></span>
							</div> -->
							<!-- <div>
								您当前等级：<span  valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')"></span>
							</div> -->
						</div>
					</div>
					
					<div class="col-sm-8 col-xs-12 col-sm-offset-2 space-1">
					
					</div>
					
					<!-- <div class="col-sm-8 col-xs-12 col-sm-offset-2 is-click menu-option menu-user-info">
						<div class="ace-icon icon-user left">
							<img src="images/user/phone.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									商户信息
								</div>
								<div class="right">
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div> -->
					
					<div class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2 menu-user-info">
						<div class="ace-icon icon-activates left">
							<img src="images/user/user_info.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									个人信息 <span  valueOf="{VIP_LEVEL}" init-format="doLevel('{value}')"></span>
								</div>
								<div class="right">
									<!-- <div class="left describe" valueOf="{CUST_LEVEL}" init-format="doLevel('{value}')""> -->
									<div class="left describe" valueOf="{TER_ACTION}" init-format="doTerAction('{value}')">
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					
					<div class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2 menu-activates">
						<div class="ace-icon icon-activates left">
							<img src="images/user/activates.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									商户激活
								</div>
								<div class="right">
									<div class="left describe" valueOf="{agentId}" init-format="doTerAction('{value}')">
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					
					<div class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2 menu-certification">
						<div class="ace-icon icon-activates left">
							<img src="images/user/certification.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									实名认证
								</div>
								<div class="right">
									<div class="left describe" valueOf="{custStatus}" init-format="doUsrStatus('{value}')">
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					
					<div class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2 menu-cardBunding">
						<div class="ace-icon icon-activates left">
							<img src="images/user/gongan.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									银行卡绑定
								</div>
								<div class="right">
									<div class="left describe" valueOf="{cardBundingStatus}" init-format="doCardBundingStatus('{value}')">
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					
					<!-- <div class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2 menu-advanced">
						<div class="ace-icon icon-activates left">
							<img src="images/user/gongan.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									公安认证
								</div>
								<div class="right">
									<div class="left describe" valueOf="{CUST_LEVEL}" init-format="doAdvancedStatus('{value}')">
									</div>
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div> -->
					
					<div class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2 menu-up-password">
						<div class="ace-icon icon-activates left">
							<img src="images/user/lock.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									修改密码
								</div>
								<div class="right">
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div>
					
					<!-- <div class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2 menu-about-us">
						<div class="ace-icon icon-activates left">
							<img src="images/user/user_info.png">
						</div>
						<div class="menu-body clear-padding">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									关于我们
								</div>
								<div class="right">
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div> -->
					
					<!-- <div class="col-sm-8 col-xs-12 is-click menu-option col-sm-offset-2 menu-my-profit">
						<div class="ace-icon icon-activates left">
							<img src="images/user/fuwushang.png">
						</div>
						<div class="menu-body clear-padding no-border">
							<div class="col-xs-12 clear-padding">
								<div class="left">
									我的收益
								</div>
								<div class="right">
									<img src="images/arrow.png" class="arrow">
								</div>
							</div>
						</div>
					</div> -->
					
					
					<div class="clearfix menu-btn-box col-sm-8 col-xs-12 col-sm-offset-2 ment-btn-exit-login">
						<button class="btn btn-info btn-lg btn-block" type="button"
							 onclick="" >
							退出登录
						</button>
					</div>
					
					<div class="dialog_list" style="display: none;">
						<div id="VIP_DESC">
							<div class="tradingExplain">
								<div class="itemdiv dialogdiv">
									<div class="body">
										<div class="name"><img src='images/user/vip_0.png' class='vip'/>&nbsp;普通商户</div>
										<div class="text">按每笔交易订单的2%收取交易费率。</div>
									</div>
								</div>
								<div class="itemdiv dialogdiv">
									<div class="body">
										<div class="name"><img src='images/user/vip_1.png' class='vip'/>&nbsp;VIP商户</div>
										<div class="text">T+1交易订单按每笔0.6%收取，实时结算交易订单，按每笔0.7%收取。</div>
									</div>
								</div>
								<!-- <div class="itemdiv dialogdiv">
									<div class="body">
										<div class="name"><img src='images/user/vip_2.png' class='vip'/>&nbsp;钻石商户</div>
										<div class="text">T+1交易订单按每笔0.35%收取(2015年8月1日后的商户不在享有此政策)，实时结算交易订单，按每笔0.7%收取。</div>
									</div>
								</div> -->
							</div>
						</div>
						<div id="derviceProviders">
							<div class="tradingExplain">
								<div class="itemdiv dialogdiv">
									<div class="body">
										<div class="text">姓名:<span valueOf="{LEGAL_NAME}"></span></div>
										<div class="text">电话:<span valueOf="{MOBLIE_NO}" init-format="doPhone('{value}')"></span></div>
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<!-- /.page-header -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->

		<!-- /.main-container -->
	</div>
		
	<link rel="stylesheet" type="text/css" href="css/dialog.css" />
	<link rel="stylesheet" type="text/css" href="css/webpay/core.1.0.css" />
	<script type="text/javascript" src="js/dialog.js" charset="UTF-8"></script>
	<script type="text/javascript" src="js/webpay/on-menu.js" charset="UTF-8"></script>
	<script type="text/javascript">
		getUserInfo(function(json){
			fillTable($(".main-content"),json);
			
			onMenuClick(json);
		});
		
		function doCard(cardNo){
			if(cardNo && cardNo.length > 10){
				return cardNo.substring(0, 6) + "****" + cardNo.substring(cardNo.length - 4);
			}else if(!cardNo){
				//未绑定银行卡可点击进入实名认证
				return "<a href=\"javascript:void(0)\" onclick=\"$('.menu-certification').trigger('click')\">未绑定</a>";
			}
			return cardNo;
		}
		////实名认证 认证状态 0：未认证 1：审核中 2：已通过  3：未通过4:一审通过
		function doUsrStatus(status){
			if(status == "0"){
				return "未认证";
			}else if(status == "1" || status == "4"){
				return "审核中";
			}else if(status == "2"){
				return "已通过";
			}else if(status == "3"){
				return "未通过";
			}
			return "未认证";
		}
		
		function doTerAction(TER_ACTION){
			if(TER_ACTION){
				return "已激活";
			}
			return "未激活";
		}
		
		function doAdvancedStatus(advStatus){
			if(advStatus == "1"){
				return "已认证";
			}
			return "未认证";
		}
		function doCardBundingStatus(value){
			if(value == '0'){
				return "未绑定";
			}else if(value == '1'){
				return "未审核";
			}else if(value == '2'){
				return "已绑定";
			}else if(value == '3'){
				return "未通过";
			}
		}
		function doLevel(value){
			if(!value){
				value = 0;
			}
			var html = "<img src='images/user/vip_"+value+".gif' class='vip' onclick='vipDesc(event)'/>";
			return html;
		}
		
		function vipDesc(evt){
			var div_id = "VIP_DESC";
			if($("#"+div_id).length == 0){
				return;
			}
			openDialog({
				title : "商户等级说明",
				width:"100%",
				height:"100%",
				target :"#"+div_id
//				pageUrl :'index.jsp'
			});
			evt.stopPropagation();
		}
		
		/* formSubmitForAjax({
			url : "getServiceProviders.web",
			success : function(json){
				var code = json["RSPCOD"];
				if(code == "000000"){
					fillTable($("#derviceProviders"),json);
					//服务商
					$(".menu-service-providers").on('click', function() {
						openDialog({
							title : "服务商信息",
							width:"100%",
							height:"100%",
							target :"#derviceProviders"
//							pageUrl :'index.jsp'
						});
					});
				}else if(code == "000009"){
					var r = confirm("您的终端尚未激活，是否现在激活？");
					if(r){
						openUrl(BASE_PATH + "user/user_activates.jsp");
					}
					return false;
				}else{
					alert(json["RSPMSG"]);
				}
			}
		}); */
		function doPhone(value){
			if(value && value.length == 11){
				return value.substring(0,3) + "-" + value.substring(3,7) + "-" + value.substring(7,11);
			}
			return value;
		}
	</script>
	 <!-- <script type="text/javascript" src="js/webpay/dial.js" charset="UTF-8"></script>
 -->	<!-- basic scripts -->
</body>
</html>